package sg.edu.nus.iss.vmcs.maintenance;

import java.awt.Button;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ButtonListener implements ActionListener{
	
	private MaintenanceController mctrl;

	public ButtonListener(MaintenanceController mc) {
		this.mctrl = mc;
	}

	public void addListener(Button button) {
		button.addActionListener(this);
	}
	
	public void actionPerformed(ActionEvent e) {
		ButtonCommand bc = (ButtonCommand)e.getSource();
		bc.execute(mctrl);
	}

}